<?xml version='1.0' encoding='ISO-8859-1' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" >

<head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
      <link href="../css/default.css" rel="stylesheet" type="text/css" />
      <title>AFF Corp</title>
      
      <script type="text/javascript">
      	function desabilitarBotao(botao) {
			botao.disabled = true;
      	}
      </script>
      
</head>
	<body>
	
	<h:form id="form" prependId="false">
		
		<rich:panel header="Acesse o AFFCorp" style="width: 400px;" rendered="#{!usuarioLoginFaces.cadastro}">
		
			<table cellpadding="3" cellspacing="3">
			
				<tr>
					<td align="right">
						<h:outputText value="Login:" />
					</td>
					<td align="left"><h:inputText
						value="#{usuarioLoginFaces.usuarioDTO.login}" styleClass="login"
						required="true" /></td>
				</tr>
			
				<tr>
					<td align="right">
						<h:outputText value="Senha:" />
					</td>
					<td align="left">
						<h:inputSecret value="#{usuarioLoginFaces.usuarioDTO.senha}" styleClass="nome" required="true" />
					</td>
				</tr>
								
				<tr>
					<td>
						<a4j:commandButton action="#{usuarioLoginFaces.acessar}"
                        value="Acessar"
                        id="botao"
                        onclick="desabilitarBotao(this);"
                        style="margin: 9px 0px 5px;"/>
					</td>
					<td>
						<a4j:status>
                        	<f:facet name="start">
                        		<h:graphicImage width="100%" url="../images/loading.gif"></h:graphicImage>
                        	</f:facet>
                        </a4j:status>
					</td>
				</tr>
			</table>
			
		</rich:panel>
	
		<rich:panel header="Cadastre-se no AFFCorp" style="width: 25%;" rendered="#{usuarioLoginFaces.cadastro}">
		
			<table cellpadding="3" cellspacing="3">
			
				<tr>
					<td>
						<h:outputText value="Login:" />
					</td>
					<td>
						<h:inputText value="#{usuarioLoginFaces.usuarioDTO.login}" styleClass="login" required="true" />
					</td>
				</tr>
			
				<tr>
					<td>
						<h:outputText value="Nome:" />
					</td>
					<td>
						<h:inputText value="#{usuarioLoginFaces.usuarioDTO.nome}" styleClass="nome" required="true" />
					</td>
				</tr>
				
				<tr>
					<td>
						<h:outputText value="Sobrenome:" />
					</td>
					<td>
						<h:inputText value="#{usuarioLoginFaces.usuarioDTO.sobreNome}" styleClass="nome" required="true" />
					</td>
				</tr>
				
				<tr>
					<td>
						<h:outputText value="Email:" />
					</td>
					<td>
						<h:inputText value="#{usuarioLoginFaces.usuarioDTO.email}" styleClass="email" required="true" />
					</td>
				</tr>	
								
				<tr>
					<td colspan="3">
						<h:commandButton action="#{usuarioLoginFaces.acessar}" value="Acessar">
						</h:commandButton>
					</td>
				</tr>
			</table>
		
		</rich:panel>
		<h:messages showDetail="true" showSummary="false" style="color: red" />
	</h:form>
	</body>
</html>